import { MigrationInterface, QueryRunner } from "typeorm";

export class SetLabelDefaultTable1712569337947 implements MigrationInterface {
    name = "SetLabelDefaultTable1712569337947";

    public async up(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(
            `ALTER TABLE \`label\` CHANGE \`labelName\` \`labelName\` varchar(255) NOT NULL DEFAULT 'default'`,
        );
        await queryRunner.query(
            `ALTER TABLE \`label\` CHANGE \`labelColor\` \`labelColor\` varchar(255) NOT NULL DEFAULT '#ff0000'`,
        );
    }

    public async down(queryRunner: QueryRunner): Promise<void> {
        await queryRunner.query(`ALTER TABLE \`label\` CHANGE \`labelColor\` \`labelColor\` varchar(255) NOT NULL`);
        await queryRunner.query(`ALTER TABLE \`label\` CHANGE \`labelName\` \`labelName\` varchar(255) NOT NULL`);
    }
}
